/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.sql.Date;

/**
 *
 * @author JArik
 */
public class Diagnose extends Item{
   // private int diagId;
    private String rusName;
    private Visit visit;
    private int execId;
    private boolean predv=true;
    private boolean deleted=false;

    public Diagnose() {
        
    }
    public Diagnose(int nId,  String nName, String nDescr, Visit nVisit)
    {
        super.setName(nName);
        super.setId(nId);
        super.setDisDate(nVisit.getDisDate());
        super.setDoctor(nVisit.getExec());
        super.setDescr(nDescr);
        visit = nVisit;
        predv = true;
    }
    public Diagnose(int nId,  String nName, String nDescr, Date nDate,Doctor nExec)
    {
        super.setName(nName);
        super.setId(nId);
        super.setDisDate(nDate);
        super.setDoctor(nExec);
        super.setDescr(nDescr);
        predv = true;
    }
    public Diagnose(int nId,  String nName, String nDescr, Date nDate,int nExec)
    {
        super.setName(nName);
        super.setId(nId);
        super.setDisDate(nDate);
        super.setDescr(nDescr);
        execId = nExec;
        predv = true;
    }
    public void setRusName(String n)
    {
        rusName = n;
    }

    public String getRusName()
    {
        if (rusName == null)
                return "";
        return rusName;
    }
    public void setFinal()
    {
        predv = false;
    }
    public void setPredv()
    {
        predv = true;
    }

    public void setDeleted(boolean del)
    {
        deleted = del;
    }
    public boolean isDeleted()
    {
        return deleted;
    }
    public int getExecId()
    {
        return execId;
    }

    public String getType()
    {
        if(predv)
            return "Предв.";
        else
            return "Оконч.";
    }
    public void setType(boolean t)
    {
        predv = t;
    }
    public boolean isPredv()
    {
        return predv;
    }
    public String toString()
    {
        //if(date !=null)
       //     return "Диагноз: " + name;
       // else
            return getName();
    }
}
